using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;

namespace ReportViewer
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool firstInstance;
            Mutex mutex = new Mutex(false, "Local\\ReportViewer", out firstInstance);
            //// If firstInstance is now true, we're the first instance of the application;
            //// otherwise another instance is running.

            if (!firstInstance)
            {
                // "English Heritage - Report Viewer" is the caption (Text property) of the main form.
                ProcessUtils.SetFocusToPreviousInstance("English Heritage - Report Viewer");
            }
            else
            {
                Reports r = new Reports();
                //r.ReportFolder = "/Photonet Reports Project";
                r.DisplayReports();
            }
        }
    }
}